import java.util.*;

//改名字
public class MainC {
    public static int n;
    public static List<List<Integer>> list = new ArrayList<>();
    public static List<Integer> path = new ArrayList<>();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = sc.nextInt();
        while (t > 0) {
            t--;
            n = sc.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = sc.nextInt();
            }
            dfs(0, arr);
            boolean flag = false;
            for (List<Integer> list1 : list) {
                if (list1.size() == 0) {
                    continue;
                }
                HashMap<Integer, Boolean> map = new HashMap<>();
                for (int i = 0; i < n; i++) {
                    map.put(arr[i], false);
                }
                int x = 0;
                int y = 0;
                for (int num : list1) {
                    x ^= num;
                    map.put(num, true);
                }
                for (Map.Entry<Integer, Boolean> entry : map.entrySet()) {
                    if (!entry.getValue()) {
                        y ^= entry.getKey();
                    }
                }
                if (x == y) {
                    flag = true;
                    break;
                }
            }
            if (flag) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }

        sc.close();
    }

    public static void dfs(int pos, int[] arr) {
        list.add(new ArrayList<>(path));

        if (pos == n) {
            return;
        }

        //选
        path.add(arr[pos]);
        dfs(pos + 1, arr);
        //回溯
        path.remove(path.size() - 1);

        //不选
        dfs(pos + 1, arr);
    }
}
